<script setup>
import { onMounted, onUnmounted } from "vue";
import router from "@/router/index";
import { _$, $ } from "./detail";

onMounted(() => {
  _$.requestParam.id = router.currentRoute.value.query.id;
  $.loadDetail();
});

onUnmounted(() => {
  $.clean();
});
</script>

<template>
  <el-space direction="vertical" fill wrap class="w-fill" :size="20">
    <el-page-header @back="router.back()">
      <template #content>
        <span class="text-large font-600 mr-3"> 资讯详情 </span>
      </template>
    </el-page-header>
    <el-card class="w-fill" shadow="never">
      <el-descriptions title="基本信息" :column="3">
        <el-descriptions-item label="用户">
          {{ _$.responseParam.userId }}
        </el-descriptions-item>
        <el-descriptions-item label="低血压">
          {{ _$.responseParam.title }}
        </el-descriptions-item>
        <el-descriptions-item label="空腹血糖">
          {{ _$.responseParam.fastingBloodSugar }}
        </el-descriptions-item>
        <el-descriptions-item label="心率">
          {{ _$.responseParam.heartRate }}
        </el-descriptions-item>
        <el-descriptions-item label="身高">
          {{ _$.responseParam.height }}
        </el-descriptions-item>
        <el-descriptions-item label="脉搏">
          {{ _$.responseParam.pulse }}
        </el-descriptions-item>
        <el-descriptions-item label="高血压">
          {{ _$.responseParam.systolicBloodPressure }}
        </el-descriptions-item>
        <el-descriptions-item label="腰围">
          {{ _$.responseParam.waistCircumference }}
        </el-descriptions-item>
        <el-descriptions-item label="体重">
          {{ _$.responseParam.weight }}
        </el-descriptions-item>
        <el-descriptions-item label="测量时间">
          {{ _$.responseParam.measurementDate }}
        </el-descriptions-item>
        <el-descriptions-item label="体检文件">
          <el-link
            type="primary"
            @click="$.onDownload(_$.responseParam.healthFile)"
            >下载</el-link
          >
        </el-descriptions-item>
      </el-descriptions>
    </el-card>
  </el-space>
</template>

<style scoped></style>
